home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / OpenLinux 2.3 CD.iso / live / usr / share / vim / syntax / vhdl.vim < prev    next >
Encoding:
Text File  |  1999-08-10  |  5.7 KB  |  160 lines

  1. " Vim syntax file
  2. " Language:    VHDL
  3. " Maintainer:    <vacancy>
  4. " Credits:    Stephan Hegel <ea273@fen.baynet.de>
  5. "        Czo (Olivier Sirol) <sirol@cao-vlsi.ibp.fr>
  6. " $Id: vhdl.vim,v 1.4 1998/03/28 19:37:33 steve Exp $
  7.  
  8. " Remove any old syntax stuff hanging around
  9. syn clear
  10.  
  11. " This is not VHDL. I use the C-Preprocessor cpp to generate different binaries
  12. " from one VHDL source file. Unfortunately there is no preprocessor for VHDL
  13. " available. If you don't like this, please remove the following lines.
  14. syn match cDefine "^#ifdef[ ]\+[A-Za-z_]\+"
  15. syn match cDefine "^#endif"
  16.  
  17. " case is not significant
  18. syn case ignore
  19.  
  20. " VHDL keywords
  21. syn keyword vhdlStatement access after alias all assert
  22. syn keyword vhdlStatement architecture array attribute
  23. syn keyword vhdlStatement begin block body buffer bus
  24. syn keyword vhdlStatement case component configuration constant
  25. syn keyword vhdlStatement disconnect downto
  26. syn keyword vhdlStatement else elsif end entity exit
  27. syn keyword vhdlStatement file for function
  28. syn keyword vhdlStatement generate generic group guarded
  29. syn keyword vhdlStatement if impure in inertial inout is
  30. syn keyword vhdlStatement label library linkage literal loop
  31. syn keyword vhdlStatement map
  32. syn keyword vhdlStatement new next null
  33. syn keyword vhdlStatement of on open others out
  34. syn keyword vhdlStatement package port postponed procedure process pure
  35. syn keyword vhdlStatement range record register reject report return
  36. syn keyword vhdlStatement select severity signal shared
  37. syn keyword vhdlStatement subtype
  38. syn keyword vhdlStatement then to transport type
  39. syn keyword vhdlStatement unaffected units until use
  40. syn keyword vhdlStatement variable wait when while with
  41. syn keyword vhdlStatement note warning error failure
  42.  
  43. " Predifined VHDL types
  44. syn keyword vhdlType bit bit_vector
  45. syn keyword vhdlType character boolean integer real time
  46. syn keyword vhdlType string severity_level
  47. " Predifined standard ieee VHDL types
  48. syn keyword vhdlType natural signed unsigned
  49. syn keyword vhdlType line text
  50. syn keyword vhdlType std_logic std_logic_vector
  51. syn keyword vhdlType std_ulogic std_ulogic_vector
  52. " Predefined non standard VHDL types for Mentor Graphics Sys1076/QuickHDL
  53. syn keyword vhdlType qsim_state qsim_state_vector
  54. syn keyword vhdlType qsim_12state qsim_12state_vector
  55. syn keyword vhdlType qsim_strength
  56.  
  57. " array attributes
  58. syn match vhdlAttribute "\'high"
  59. syn match vhdlAttribute "\'left"
  60. syn match vhdlAttribute "\'length"
  61. syn match vhdlAttribute "\'low"
  62. syn match vhdlAttribute "\'range"
  63. syn match vhdlAttribute "\'reverse_range"
  64. syn match vhdlAttribute "\'right"
  65. syn match vhdlAttribute "\'ascending"
  66. " block attributes
  67. syn match vhdlAttribute "\'behaviour"
  68. syn match vhdlAttribute "\'structure"
  69. syn match vhdlAttribute "\'simple_name"
  70. syn match vhdlAttribute "\'instance_name"
  71. syn match vhdlAttribute "\'path_name"
  72. syn match vhdlAttribute "\'foreign"
  73. " signal attribute
  74. syn match vhdlAttribute "\'active"
  75. syn match vhdlAttribute "\'delayed"
  76. syn match vhdlAttribute "\'event"
  77. syn match vhdlAttribute "\'last_active"
  78. syn match vhdlAttribute "\'last_event"
  79. syn match vhdlAttribute "\'last_value"
  80. syn match vhdlAttribute "\'quiet"
  81. syn match vhdlAttribute "\'stable"
  82. syn match vhdlAttribute "\'transaction"
  83. syn match vhdlAttribute "\'driving"
  84. syn match vhdlAttribute "\'driving_value"
  85. " type attributes
  86. syn match vhdlAttribute "\'base"
  87. syn match vhdlAttribute "\'high"
  88. syn match vhdlAttribute "\'left"
  89. syn match vhdlAttribute "\'leftof"
  90. syn match vhdlAttribute "\'low"
  91. syn match vhdlAttribute "\'pos"
  92. syn match vhdlAttribute "\'pred"
  93. syn match vhdlAttribute "\'rightof"
  94. syn match vhdlAttribute "\'succ"
  95. syn match vhdlAttribute "\'val"
  96. syn match vhdlAttribute "\'image"
  97. syn match vhdlAttribute "\'value"
  98.  
  99. syn keyword vhdlBoolean true false
  100.  
  101. " for this vector values case is significant
  102. syn case match
  103. " Values for standard VHDL types
  104. syn match vhdlVector "\'[0L1HXWZU\-\?]\'"
  105. " Values for non standard VHDL types qsim_12state for Mentor Graphics Sys1076/QuickHDL
  106. syn keyword vhdlVector S0S S1S SXS S0R S1R SXR S0Z S1Z SXZ S0I S1I SXI
  107. syn case ignore
  108.  
  109. syn match  vhdlVector "B\"[01_]\+\""
  110. syn match  vhdlVector "O\"[0-7_]\+\""
  111. syn match  vhdlVector "X\"[0-9a-f_]\+\""
  112. syn match  vhdlCharacter "\'[&><=:+\-*\/().,;\'$#|~!%@?\^\[\]{}\\a-z0-9 ]\'"
  113. syn region vhdlString start=+"+  end=+"+
  114.  
  115. " floating numbers
  116. syn match vhdlNumber "-\=\<\d\+\.\d\+\(E[+\-]\=\d\+\)\>"
  117. syn match vhdlNumber "-\=\<\d\+\.\d\+\>"
  118. syn match vhdlNumber "0*2#[01_]\+\.[01_]\+#\(E[+\-]\=\d\+\)\="
  119. syn match vhdlNumber "0*16#[0-9a-f_]\+\.[0-9a-f_]\+#\(E[+\-]\=\d\+\)\="
  120. " integer numbers
  121. syn match vhdlNumber "-\=\<\d\+\(E[+\-]\=\d\+\)\>"
  122. syn match vhdlNumber "-\=\<\d\+\>"
  123. syn match vhdlNumber "0*2#[01_]\+#\(E[+\-]\=\d\+\)\="
  124. syn match vhdlNumber "0*16#[0-9a-f_]\+#\(E[+\-]\=\d\+\)\="
  125. " operators
  126. syn keyword vhdlOperator and nand or nor xor xnor
  127. syn keyword vhdlOperator rol ror sla sll sra srl
  128. syn keyword vhdlOperator mod rem abs not
  129. syn match   vhdlOperator "[&><=:+\-*\/|]"
  130. syn match   vhdlSpecial  "[().,;]"
  131. " time
  132. syn match vhdlTime "\<\d\+\s\+\(\([fpnum]s\)\|\(sec\)\|\(min\)\|\(hr\)\)\>"
  133. syn match vhdlTime "\<\d\+\.\d\+\s\+\(\([fpnum]s\)\|\(sec\)\|\(min\)\|\(hr\)\)\>"
  134.  
  135. syn match vhdlComment "--.*$"
  136. " syn match vhdlGlobal "[\'$#~!%@?\^\[\]{}\\]"
  137.  
  138. if !exists("did_vhdl_syntax_inits")
  139.   let did_vhdl_syntax_inits = 1
  140.   " The default methods for highlighting. Can be overridden later
  141.   hi link cDefine       PreProc
  142.   hi link vhdlSpecial   Special
  143.   hi link vhdlStatement Statement
  144.   hi link vhdlCharacter String
  145.   hi link vhdlString    String
  146.   hi link vhdlVector    String
  147.   hi link vhdlBoolean   String
  148.   hi link vhdlComment   Comment
  149.   hi link vhdlNumber    String
  150.   hi link vhdlTime      String
  151.   hi link vhdlType      Type
  152.   hi link vhdlOperator  Type
  153.   hi link vhdlGlobal    Error
  154.   hi link vhdlAttribute Type
  155. endif
  156.  
  157. let b:current_syntax = "vhdl"
  158.  
  159. " vim: ts=8
  160.